package com.example.controller.global;

import com.example.exception.global.CustomerException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/9/21 15:38
 */
@Controller
public class TestController {
    /**
     * http://localhost:84/runTime
     * 全局异常捕捉
     * @return
     */
    @RequestMapping(value = "runTime")
    public String runTime(){
        System.out.println("runTime");
        throw new RuntimeException("runTime 异常测试");
    }

    /**
     *
     * @return
     */
    @RequestMapping(value = "customer")
    public String customer() throws CustomerException {
        System.out.println("customer");
        throw new CustomerException("customer 异常测试");
    }

}
